import { ResPage, Textbook, ResultData } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 数字教材管理模块
 */
// 获取数字教材列表
export const getTextbookList = (params: Textbook.ReqTextbookParams) => {
  return http.post<ResPage<Textbook.ResTextbookList>>(`/textbook/query`, params);
};
// 获取数字教材详情
export const getTextbookDtl = (params: { textbookId: number }) => {
  return http.post<ResultData>(`/textbook/detail`, params);
};
// 新增数字教材
export const addTextbook = (params = {}) => {
  return http.post(`/textbook/add`, params);
};
// 编辑数字教材
export const editTextbook = (params: { textbookId: string }) => {
  return http.post(`/textbook/modify`, params);
};

// 删除数字教材
export const deleteTextbook = (params: { textbookList: { textbookId: string }[] }) => {
  return http.post(`/textbook/remove`, params);
};
